
const path = require('path')
 
function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    publicPath: '/', // 从 Vue CLI3.3 起已弃用，请使用publicPath
    outputDir: 'dist',
    devServer: {// 环境配置
        host: '0.0.0.0',
        port: 8888,
        open: true, //配置自动启动浏览器
        proxy: {
            '/api': {
            //   // target: 'http://192.168.0.159:8080',
            //   // target: 'http://192.168.0.180:8080',
            //   // target: 'http://ihospital.doctoradmin.ebaiyihui.com',
              target: 'http://192.168.238.126:8083',
              ws: true,
              changeOrigin:true,//允许跨域
              pathRewrite: {
                '^/api': ''
              }
            }
          }
    },
    // vue3.0
    chainWebpack: config => {
        config.resolve.alias
            .set("@", resolve("src"))
            .set("assets", resolve("src/assets"))
            .set("components", resolve("src/components"))
            .set("views", resolve("src/views"))
    },
}